require(['loading'], function(loading) {
	var app = new Vue({
		el: '#app',
		data: {
			tabIndex: 1,
			info: {},
			goods: [],
			showLoading: true
		},
		ready: function(){
			var self = this;
			this.$http.get(wxUrls + '/v3.3/farm/farmInfo',{
				params:{
					userToken: userToken,
					token: token
				}
			}).then(function(resp){
				var result = JSON.parse(resp.body);
				if(result.code == 0 ) { // 业务数据正常
					self.info = result.data;
					self.farmId = result.data.farmId;
					self.goods = result.data.goods;
				} else if (result.code == 10395){
					window.location.href = '../wantSale/editShop.html';
				} else if (result.code == 10601) { // 店铺信息不存在，跳转到完善店铺信息页面
					window.location.href = '../wantSale/editShop.html';
				} 
			});
		}
	});
});


// 为可控制返回指定页面所有添加pushState
history.pushState({}, document.title, null);
pushVHistory();
window.addEventListener("popstate", function() {
    // 跳转到订单列表页面
	goBackVHistory();
});